class FriendsController < ApplicationController
	before_filter :login_required	

	def request_friendship
		friend = User.find(params[:friend_id])
		if current_user.is_friends_or_pending_with? friend
			current_user.accept_friendship_with friend
		else
			current_user.request_friendship_with friend
		end
		render :text => "Добавлен в друзья"
	end

	

end 
